﻿using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Messaging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace GJB.ML.Message.ViewModel
{
    public class MainViewModel : ViewModelBase
    {
        private string myVar;

        public string MyProperty
        {
            get { return myVar; }
            set { myVar = value; 
                this.RaisePropertyChanged(); }
        }

        public MainViewModel()
        {
            this.MyProperty = "1212121";
        }

        public ICommand BtnCommand
        {
            get => new RelayCommand(() =>
            {
                Messenger.Default.Send<string>("123");
            });

            //泛型类型一般时引用类型
            //get => new RelayCommand<string>(obj =>
            //{
            //});
        }
    }
}
